﻿@inject IStringLocalizer<Foo> FooLocalizer
@inject IStringLocalizer<TablesColumnText> Localizer

<Table TItem="Foo" Items="@Items.Take(3)">
    <TableColumns>
        <TableColumn @bind-Field="@context.DateTime" Text="@Localizer["CustomColText1"]" Width="180" />
        <TableColumn @bind-Field="@context.Name" Text="@Localizer["CustomColText2"]" />
        <TableColumn @bind-Field="@context.Address" Text="@Localizer["CustomColText3"]" />
        <TableColumn @bind-Field="@context.Complete" />
    </TableColumns>
</Table>

@code {
    /// <summary>
    /// Foo 类为Demo测试用，如有需要请自行下载源码查阅
    /// Foo class is used for Demo test, please download the source code if necessary
    /// https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/main/src/BootstrapBlazor.Shared/Data/Foo.cs
    /// </summary>
    [NotNull]
    private List<Foo>? Items { get; set; }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Items = Foo.GenerateFoo(FooLocalizer);
    }
}
